#循环输出student_info2列表的元素值
# student_info2 = [
#     [1,'lhy','北京' ],
#     [2,'hzy','北京'],
#     [3,'ljj','北京']
# ]
# index =0
# stuent_len = len(student_info2)#list的长度
# while index <stuent_len:
#     stu = student_info2[index]
#     # 拆包
#     num,name,addr = stu
#
#     sql = "insert into student VALUE ('{num}','{name}','{addr}');".format(num = num,name = name,addr = addr)
#
#     index+=1
#     print(sql)

student_info2 = [
    [1,'lhy','北京' ],
    [2,'hzy','北京'],
    [3,'ljj','北京']
]

for stu in student_info2:
    num, name, addr = stu

    sql = "insert into student VALUE ('{num}','{name}','{addr}');".format(num=num, name=name, addr=addr)

    print(sql)